package cn.admin.remoting.serialize.impl.hessian;

import cn.admin.config.common.lang.enumeration.Enum;
import com.caucho.hessian.io.AbstractSerializerFactory;
import com.caucho.hessian.io.Deserializer;
import com.caucho.hessian.io.HessianProtocolException;
import com.caucho.hessian.io.Serializer;

public class AliEnumSerializerFactory extends AbstractSerializerFactory {

    @Override
    public Serializer getSerializer(Class aClass) throws HessianProtocolException {
        return Enum.class.isAssignableFrom(aClass) ? new AliEnumSerializer(aClass) : null;
    }

    @Override
    public Deserializer getDeserializer(Class aClass) throws HessianProtocolException {
        return Enum.class.isAssignableFrom(aClass) ? new AliEnumDeserializer(aClass) : null;
    }
}
